const express = require('express')
const app = express()
const path = require('path')
const server = require('http').createServer(app)

const router = require('./router/main_router.js')
const memberRouter = require('./router/member.js')
const casesRouter = require('./router/cases.js')

app.use(router)
app.use(memberRouter)
app.use(casesRouter)

app.use('/static/',express.static(path.join(__dirname,'./static/')))
app.use('/css/',express.static(path.join(__dirname,'./static/css/')))
app.use('/fonts/',express.static(path.join(__dirname,'./static/fonts/')))
app.use('/img/',express.static(path.join(__dirname,'./static/img/')))
app.use('/js/',express.static(path.join(__dirname,'./static/js/')))
app.use('/node_modules/',express.static(path.join(__dirname,'./node_modules/')))

server.listen(3000, () => {
    console.log('server is listen 3000')
})

// socket.io
require('./socket/socketio.js')(server)